<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="postjson.js"></script>
<script type="text/javascript">
$(function() {
	new Postjson('postjson:')
	.call('test.nanjing')
	.call('test.beijing', 'capital', function(state, rt){;})
	.call('test.shanghai', 11)
	.call('test.guangzhou', 13)
	.call('test.shenzhen', true)
	.call('test.dongguan', 13.040)
	.call('test.hefei', 15.090)
	.call('test.date', new Date())
	.call('test.stringArray', ['hello', 'world'])
	.call('test.stringArray', [])
	.call('test.stringArray', ['hook'], function(state, rt){alert(state + rt);})
	.call('test.stringArray', null)
	.call('test.dualString', 'hello', 'world')
	.call('test.dualString')
	.call('test.dualString', 'jetty')
	.call('test.dualString', null)
	.request('postjson.ajax');

	new Postjson()
	.call('com.itealabs.postjson.test.TestReflectionJsonCallWaiter.beijing')
	.request('postjson.ajax');

	var print = function(state, rt){$('div').append(JSON.stringify(rt) + '<br/>');};
	$('#btn-1').click(function(){
		new Postjson('com.itealabs.postjson.test.PrimaryTypesTest.')
		.call('testString', 'hello', print)
		.call('testInteger', 2147483647, print)
		.call('testInteger', -2147483648, print)
		.call('testLong', 2147483648, print)
		.call('testLong', -2147483649, print)
		.call('testLong', 9223372036854775000, print)
		.call('testLong', -9223372036854775000, print)
		.call('testFloat', 3.345667, print)
		.call('testFloat', -9993.345667, print)
		.call('testDouble', 3.345667, print)
		.call('testDouble', -9993.345667, print)
		.call('testBoolean', true, print)
		.call('testByte', 55, print)
		.call('testChar', 'r', print)
		.call('testShort', 3333, print)
		.request('postjson.ajax');
	});
	$('#btn-2').click(function(){
		new Postjson('com.itealabs.postjson.test.CollectionsTest.')
		.call('testList', ['hello', 'world'], print)
		.call('testSet', ['hello', 'world'], print)
		.call('testCollection', ['hello', 'world'], print)
		.call('testMap', {beijin: 1, shanghai: 2}, print)
		.call('testVarArgs')
		.call('testVarArgs', 'a')
		.call('testVarArgs', 'a', 'b', 'c')
		.call('testMixVarArgs')
		.call('testMixVarArgs', 333)
		.call('testMixVarArgs', 444, 'bc')
		.call('', 333)
		.request('postjson.ajax');
	});

	$('#btn-3').click(function(){
		new Postjson().request('postjson.ajax');
		new Postjson().call().request('postjson.ajax');
	});

	$('a').click(function(){
		$('div').empty();
	});

});
</script>
<style type="text/css">

</style>
</head>
<body><p>
<a href="javascript:;" >CLEAR</a>
<input id="btn-1" type="button" value="testPrimaryTypes"/>
<input id="btn-2" type="button" value="testCollectionTypes"/>
<input id="btn-3" type="button" value="moreTest"/></p>
<div></div>
</body>
</html>